package com.microblog.microblogsystem.mapper;

import com.github.pagehelper.Page;
import com.microblog.microblogsystem.domain.dto.BlogPageQueryDTO;
import com.microblog.microblogsystem.domain.po.Blog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.microblog.microblogsystem.domain.vo.BlogPageQueryVO;
import com.microblog.microblogsystem.domain.vo.BlogReadVO;
import com.microblog.microblogsystem.domain.vo.CommentVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author itlxc
 * @since 2024-06-28
 */
@Mapper
public interface BlogMapper extends BaseMapper<Blog> {

    /**
     * 分页查询
     * @param blogPageQueryDTO
     * @return
     */
    Page<BlogPageQueryVO> pageQuery(BlogPageQueryDTO blogPageQueryDTO);

    /**
     * 根据id查询博客信息
     *
     * @param bid
     * @return
     */
    BlogReadVO getById(Long bid);

    /**
     * 根据id查询博客评论信息
     *
     * @param bid
     * @return
     */
    List<CommentVO> getCommentById(Long bid);
}
